package com.example.seataBusiness.feign;

import com.example.seataBusiness.common.response.ObjectResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "seata-storage")
public interface StorageServiceFeignClient {

    /**
     * 扣减库存服务接口
     *
     * @param commodityCode 产品编号
     * @param count         订单产品数量
     */
    @PostMapping("/storage")
    ObjectResponse<Object> deduct(@RequestParam("commodityCode") String commodityCode,
                                 @RequestParam("count") Integer count);
}
